package com.ctgu.fcftsystem.service;

import com.ctgu.fcftsystem.dao.SpendDao;
import com.ctgu.fcftsystem.pojo.Spend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class SpendServiceImpl implements SpendService{

    @Autowired(required=false)
    private SpendDao spendDao;

    @Override
    public List<Spend> findByPaging(int pageCount, int pageSize) {
        return spendDao.findByPaging(pageCount, pageSize);
    }

    @Override
    public int addSpend(Spend spend) {

        return spendDao.addSpend(spend);
    }

    @Override
    public List<Spend> getSpendList() {
        return spendDao.getSpendList();
    }

    @Override
    public int delSpendById(int sid) {
        return spendDao.delSpendById(sid);
    }

    @Override
    public int updateSpend(Spend spend) {
        return spendDao.updateSpend(spend);
    }

    @Override
    public List<Spend> searchSpend(Spend spend) {
        return spendDao.searchSpend(spend);
    }
}
